<?php

namespace app\forms;

class DemoForm extends \yii\base\Model
{
    public $id;
    public $name;
    public $desc;

    public function rules()
    {
        return [
            [['name', 'desc', 'id'], 'safe'],
            [['name'], 'required'],
        ];
    }

    public function attributes()
    {
        return ['name', 'desc'];
    }

    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => '名字',
            'desc' => '描述',
        ];
    }
}